name: Test
on: [push]
jobs:
  format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: stable
      - uses: actions/checkout@master
      - run: rustup component add rustfmt
      - run: cargo fmt --all -- --check
  test:
    runs-on: ${{ matrix.os }}
    continue-on-error: ${{ matrix.experimental }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, windows-latest, macOS-latest]
        rust: [stable]
        experimental: [false]
        include:
          - rust: nightly
            os: ubuntu-latest
            experimental: true
    steps:
      - uses: actions-rs/toolchain@v1
        with:
          toolchain: ${{ matrix.rust }}
      - uses: actions/checkout@master
      - name: Run tests
        run: |
          cargo test --test lib
          cargo test --test lib --features "debug-embed"
          cargo test --test lib --features "compression" --release
          cargo test --test interpolated_path --features "interpolate-folder-path"
          cargo test --test interpolated_path --features "interpolate-folder-path" --release
          cargo build --example basic
          cargo build --example actix --features actix
          cargo build --example warp --features warp-ex
          cargo test --test lib --release
          cargo build --example basic --release
          cargo build --example actix --features actix --release
          cargo build --example warp --features warp-ex --release
